#include <iostream>
#include <queue>
#define ULL unsigned long long
using namespace std;

const int kMaxN = 1e6 + 10;

ULL a[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, k;
  deque<ULL> deq;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (int i = 0; i < k - 1; i++) {
    for (; !deq.empty() && a[deq.back()] <= a[i]; deq.pop_back());
    deq.push_back(i);
  }
  for (int i = k - 1; i < n; i++) {
    for (; !deq.empty() && a[deq.back()] <= a[i]; deq.pop_back());
    deq.push_back(i);
    cout << deq.size() << "\n";
    if (deq.front() <= i - k + 1) {
      deq.pop_front();
    }
  }
  cout << 1e9 + 6 << endl;
  n = 5e8 + 3;
  cout << 2 << endl;
  for (int i = 3; i <= n; i += 2) {
    while (n % i == 0) {
      cout << i << endl;
      n /= i;
    }
  }
  return 0;
}